import Vue from "vue";
import VueRouter from "vue-router";
import Vuex from "vuex";
import Index from "../components/Index.vue";
import Course from "../components/Course.vue";
// 导入账号设置组件
import Settings from "../components/Settings.vue";
// 导入修改密码组件
import Password from "../components/Password.vue";

Vue.use(VueRouter);
Vue.use(Vuex);

const videoDetail = () => import("../components/videoDetail.vue");

const routes = [
  {
    path: "/",
    name: "Index",
    component: Index,
    meta: {
      title: "首页",
    },
  },
  {
    path: "/Course",
    name: "Course",
    component: Course,
    meta: {
      title: "课程简介页",
    },
  },
  {
    path: "/videoDetail",
    name: "videoDetail",
    component: videoDetail,
    meta: {
      title: "视频播放页",
    },
  },
  // 配置账号设置的路由
  {
    path: "/setting",
    name: "Setting",
    component: Settings,
    meta: {
      title: "账号设置",
    },
  },
  // 配置修改密码的路由
  {
    path: "/password",
    name: "Password",
    component: Password,
    meta: {
      title: "密码设置",
    },
  },
  //{
  // path: '/about',
  // name: 'About',
  // // route level code-splitting
  // // this generates a separate chunk (about.[hash].js) for this route
  // // which is lazy-loaded when the route is visited.
  // component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  //}
];

const router = new VueRouter({
  routes,
});

export default router;
